<?php
namespace Oa\Controller;

class LoginController extends BaseController
{
    public function login()
    {
        if(IS_AJAX){
            $mobile = I('post.mobile');
            $password = encode(I('post.password'));
            $data=array('mobile'=>$mobile,'password'=>$password);
            $res=D('User')->verifyLogin($data);
            if($res){

//               self::ajaxSuccess('登录成功');
               $this->redirect(__ROOT__.'oa/index/index');
            }else{
               self::ajaxError('用户名或密码错误');
            }
        }else{
            $this->display();
        }


    }
}